#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, A, B;
    cin >> n >> A >> B;
    string s;
    cin >> s;

    vector<int> prea(n + 1, 0);
    vector<int> preb(n + 1, 0);
    ll ans = 0;

    for (int i = 1; i <= n; i++) {
        prea[i] = prea[i - 1] + (s[i - 1] == 'a' ? 1 : 0);
        preb[i] = preb[i - 1] + (s[i - 1] == 'b' ? 1 : 0);
    }

    for (int l = 0; l < n; l++) {
        auto tmpa = lower_bound(prea.begin() + l, prea.end(), prea[l] + A);
        if (tmpa == prea.end()) {
            continue;
        }
        int al = tmpa - prea.begin();
        auto tmpb = upper_bound(preb.begin() + l + 1, preb.end(), preb[l] + B - 1);
        int bl = tmpb - preb.begin();
        ans += max(0, bl - al);

    }

    cout << ans << endl;

    return 0;
}